﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BaiduFanyi
{
    public class PropertyInfo
    {
        public bool HaveAssignType = false;

        public string TypeName = "string";

        public string ControlName = "";

        /// <summary>
        /// 是否绑定ID
        /// </summary>
        public bool IsContainsID = false;

        /// <summary>
        /// 译文
        /// </summary>
        public string dst = "";

        private string m_PrepertyName;
        public string PrepertyName
        {
            get { return m_PrepertyName; }
            set
            {
                m_PrepertyName = value;
                if (!HaveAssignType && ConfigurationManager.AppSettings["AutoSetTypeName"] == "true")
                {
                    GetTypeName(m_PrepertyName);
                }
            }
        }

        private void GetTypeName(string prepertyName)
        {
            if (prepertyName.ToLower().Contains("id"))
            {
                TypeName = "int";
            }
        }
    }
}
